package com.hhxy.book.controller;


import com.hhxy.R;
import com.hhxy.book.entity.Books;
import com.hhxy.book.service.BooksService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 一粒尘埃
 * @since 2023-03-04
 */
@RestController
@RequestMapping("/book/books")
public class BooksController {

    @Autowired
    private BooksService booksService;

    @GetMapping("getById")
    public R getById() {
        Books byId = booksService.getById(1);
        return R.ok().data("data",byId);
    }

}

